public class Example8_7 {
    public static void main(String args[]) {
	try{
       byte d[]="Java你好".getBytes("GB2312");
 
       System.out.println("数组d的长度是:"+d.length);
       String s=new String(d,6,2); 
       System.out.println(s);
       s=new String(d,0,6);
       System.out.println(s);  
    }
 catch(Exception e){
            System.out.println("error");
        }


    }
}



